package util;

import java.util.Comparator;

import models.ExtendedCloudlet;

/*
 * Comparator Java per ordinare le Cloudlet in ordine cronologico 
 */

public class TimeComparator implements Comparator<ExtendedCloudlet> {

	@Override
	public int compare(ExtendedCloudlet arg0, ExtendedCloudlet arg1) {
		int res = 0;

		if(arg0.getActualSubmitTime() < arg1.getActualSubmitTime())
			res = -1;

		if(arg1.getActualSubmitTime() < arg0.getActualSubmitTime())
			res = 1;

		return res;
	}

}
